<?php
namespace app\index\controller;
use think\Controller;
use think\Db;
use think\Session;
class Index extends Controller
{
    public function index()
    {
        $islog = Session::get('isLog');
        if(!$islog){
            return $this->login();
        }
        $this->assign('info',$islog);
        return $this->fetch("index");
    }
    public function login(){
        
        return $this->fetch("login");
    }
    public function logout(){
        Session::delete('isLog');
         return $this->login();
    }
    public function map()
    {
        $view = $this->fetch("map");
        $ut = new Utiltool($view);
        return $ut->getpdata();
    }
    public function getmappoint()
    {
        $result=Db::table('distribution_point')->select();
        if($result)
        {
            $data = array(
                'code'=>0,
                'msg'=>'Success',
                'result'=>$result
            );
            return json_encode($data);
        }else
        {
            $data = array(
                'code'=>99,
                'msg'=>'Fail',
                'result'=>null
            );
            return json_encode($data);
        }
    }
    public function to_complete()
    {
        $view = $this->fetch("to_complete");
        $ut = new Utiltool($view);
        return $ut->getpdata();
    }
    public function completed()
    {
        $view = $this->fetch("completed");
        $ut = new Utiltool($view);
        return $ut->getpdata();
    }
    /**
     * Author:stardotdot
     */
    public function uncomplete()
    {
        $view = $this->fetch("uncomplete");
        $ut = new Utiltool($view);
        return $ut->getpdata();
    }
    public function user_management()
    {
        $view = $this->fetch("user_management");
        $ut = new Utiltool($view);
        return $ut->getpdata();
    }
    public function ability()
    {
        $view = $this->fetch("ability");
        $ut = new Utiltool($view);
        return $ut->getpdata();
    }
    public function factoryManagement()
    {
        $view = $this->fetch("factory_management");
        $ut = new Utiltool($view);
        return $ut->getpdata();
    }
    public function bournManagement()
    {
        $view = $this->fetch("bourn_management");
        $ut = new Utiltool($view);
        return $ut->getpdata();
    }
    public function about()
    {
        $view = $this->fetch("about");
        $ut = new Utiltool($view);
        return $ut->getpdata();
    }
    public function allcomplete()
    {
        $view = $this->fetch("all_complete");
        $ut = new Utiltool($view);
        return $ut->getpdata();
    }
    public function chartmanage()
    {
        $view = $this->fetch("chartmanage");
        $ut = new Utiltool($view);
        return $ut->getpdata();
    }
    public function productionOrder(){
        $view = $this->fetch("production_order");
        $ut = new Utiltool($view);
        return $ut->getpdata();
    }
    public function nomenclature(){
        $view = $this->fetch("nomenclature");
        $ut = new Utiltool($view);
        return $ut->getpdata();
    }
    public function zhjtest()
    {
        $view = $this->fetch("zhjtest");
        $ut = new Utiltool($view);
        return $ut->getpdata();
    }
}
